<?php
$form = $this->beginWidget('CActiveForm', array(
    'id' => 'menu-form',
    'enableAjaxValidation' => false,
    'enableClientValidation' => true,
    'htmlOptions' => array(
        'class' => 'form-horizontal',
        'enctype' => 'multipart/form-data',
    ),
        ));
?>
<div class="row-fluid">

    <div class="control-group">
        <label class="control-label">Page</label>
        <div class="controls">
            <?php echo $form->dropDownlist($model, 'menu_id', MyFunctionCustom::cms(),array('empty' => '-- Select Page --'));?>
            <span class="help-inline"><?php echo $form->error($model, 'menu_id'); ?></span>
            
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">Title</label>
        <div class="controls">
            <?php
                echo $form->textField($model,'title', array("placeholder"=>"Title","maxlength"=>"100", "size"=>"60"))
            ?>
            <span class="help-inline"><?php echo $form->error($model, 'title'); ?></span>
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">Cover Photo</label>
        <div class="controls span3" style="margin:10px">
            <?php echo $form->fileField($model, 'cover_photo', array('class' => 'id-input-file-1')); ?>
            <span class="help-inline"><?php echo $form->error($model, 'cover_photo'); ?></span>
        </div>
    </div>
    
    <div class="control-group">
        <div class="controls">
            <?php if($model['cover_photo']):?>
                <img src="<?php echo Yii::app()->baseUrl.'/timthumb.php?src=' . Yii::app()->baseUrl .'/images/'. $model['cover_photo']?>&h=100&w=100">
            <?php endif;?>
        </div>
    </div>
     <div class="controls">
        <label>
            <input name="Cms[index]" type="checkbox" <?php if($model['index']) echo "checked='checked'";?>>
            <span class="lbl"> Show in homepage</span>
        </label>
    </div>
    <div class="control-group" >
        <label class="control-group">Short Decription</label>
    </div>       
        <?php
            $this->widget('ext.editMe.ExtEditMe', array(
            //'name' => 'short_description',
            'id' => 'short_description_',
            'height' => '250px',
            'model' => $model,
            'width' => '100%',
            'attribute' => 'short_description',
            'toolbar' => Yii::app()->params['ckeditor'],
            'filebrowserBrowseUrl' => Yii::app()->baseUrl . '/ckfinder/ckfinder.html',
            'filebrowserImageBrowseUrl' => Yii::app()->baseUrl . '/ckfinder/ckfinder.html?type=Images',
            'filebrowserFlashBrowseUrl' => Yii::app()->baseUrl . '/ckfinder/ckfinder.html?type=Flash',
            'filebrowserUploadUrl' => Yii::app()->baseUrl . '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
            'filebrowserImageUploadUrl' => Yii::app()->baseUrl . '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
            'filebrowserFlashUploadUrl' => Yii::app()->baseUrl . '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash',
        ));
    ?>


    <div class="control-group" >
        <label class="control-group">Full Decription</label>
    </div>       
        <?php
            $this->widget('ext.editMe.ExtEditMe', array(
            //'name' => 'short_description',
            'id' => 'description_',
            'height' => '250px',
            'model' => $model,
            'width' => '100%',
            'attribute' => 'description',
            'toolbar' => Yii::app()->params['ckeditor'],
            'filebrowserBrowseUrl' => Yii::app()->baseUrl . '/ckfinder/ckfinder.html',
            'filebrowserImageBrowseUrl' => Yii::app()->baseUrl . '/ckfinder/ckfinder.html?type=Images',
            'filebrowserFlashBrowseUrl' => Yii::app()->baseUrl . '/ckfinder/ckfinder.html?type=Flash',
            'filebrowserUploadUrl' => Yii::app()->baseUrl . '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
            'filebrowserImageUploadUrl' => Yii::app()->baseUrl . '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
            'filebrowserFlashUploadUrl' => Yii::app()->baseUrl . '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash',
        ));
    ?>

    <div class="form-actions">
        <button class="btn btn-info" type="submit">
            <i class="icon-ok bigger-110"></i>Submit
        </button>
    </div>
</div>
<?php $this->endWidget(); ?>